import { mapMutations, mapState, mapActions } from "vuex";
export default {
  data() {
    return {};
  },
  computed: {
    ...mapState({
      loginUserinfo: state => state.global.loginUserinfo,
    })
  },
  methods: {
    ...mapActions({
      // global
    }),
    ...mapMutations({
      // global
      changeLoginUserInfo: "global/changeLoginUserInfo",
    }),
    $imgDomainUrl(path, type = "avatar", mode) {
      if (path && path.indexOf("http") != -1) {
        return path;
      } else {
        if (path && path.length > 0) {
          path = path.substr(0, 1) === "/" ? path : "/" + path;
          if (mode === 1) {
            return this.imgDomain + (type == "open" ? "/user/open" : "") + path;
          } else {
            return this.upDomain + (type == "open" ? "/user/open" : "") + path;
          }
        } else {
          return path;
        }
      }
    },
  },
  created() {}
};
